<ion-view cache-view="false">
    <ion-nav-title>{{vm.activeTab==1 ? '充值': (vm.activeTab==2 ? '提现' : "资金明细")}}</ion-nav-title>
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-header-bar class="bar-subheader" style="padding:5px 0">
        <div class="tab clearfix">
            <ul>
                <li ng-class="{current: vm.activeTab == 1}" style="width:30%">
                    <em ng-click="vm.activeTab=1;">充值</em></li>

                <li ng-class="{current: vm.activeTab == 2}" style="width:30%">
                    <em ng-click="vm.activeTab=2;">提现</em></li>

                <li ng-class="{current: vm.activeTab == 3}" style="width:40%">
                    <em ng-click="vm.activeTab=3;">资金明细</em></li>
            </ul>
        </div>
    </ion-header-bar>
    <ion-content ng-class="{'has-loading': isOffline}">
        <div ng-show="vm.activeTab==1" ng-controller="account_RechargeCtrl">
            <!-- tips -->
            <div class="tips">办理时间：每周一至周五9:00-16:00</div>
            <!-- panel -->
            <div class="panel">
                <div class="item">
                    <span class="txt bank" ng-if="'1' == bank.bkaccount_regflag">
                        <img ng-src="{{bank.small_icon}}" class="icBank"/>{{bank.bank_name}}</span>
                    <span class="txt bank" ng-if="'1' != bank.bkaccount_regflag">
                        <img ng-src="{{bank.small_icon}}" class="icBank"/>{{bank.bank_name}}      尾号（{{bank.bank_account_show}}）</span>
                </div>
                <div class="item">
                    <span class="title">金额</span>
                    <input type="number" class="txt_m" ng-model="recharge.occur_balance" digital-keyboard=false
                           step="0.01" ng-blur="fixBalance()" maxlength="10" min="0" placeholder="请输入充值到保证金账户的金额" />
                </div>
                <div class="item">
                    <span class="title">银行卡密码</span>
                    <input type="password" class="txt_m"  maxlength="6" ng-model="recharge.bank_password" placeholder="请输入银行卡密码"
                           digital-keyboard="recharge.bank_password"/>
                </div>
            </div>
            <div class="bp tar">
                <a class="clr1" href="#/query-balance" digital-keyboard=false>查询银行卡余额</a>
            </div>
            <!-- button -->
            <div class="btnbox">
                <a class="btn" id="recharge" ng-click="rechargeClick()">确 定</a>
            </div>
        </div>

        <div ng-show="vm.activeTab==2" ng-controller="account_WithdrawCtrl">
            <div class="tips">办理时间：每周一至周五9:00-16:00</div>
            <!-- panel -->
            <div class="panel">
                <div class="item">
                    <span class="title">可提现金额</span>
                    <span class="txt_m"><em class="amount">{{amount | defNumber}}</em>元</span>
                </div>
                <div class="item">
                <span class="txt bank" ng-if="'1' == bank.bkaccount_regflag">
                    <img ng-src="{{bank.small_icon}}" class="icBank"/>{{bank.bank_name}}</span>
                <span class="txt bank" ng-if="'1' != bank.bkaccount_regflag">
                    <img ng-src="{{bank.small_icon}}" class="icBank"/>{{bank.bank_name}}      尾号（{{bank.bank_account_show}}）</span>
                </div>
                <div class="item">
                    <span class="title">提现金额</span>
                    <input type="number" class="txt_m" value="" name="occur_balance" ng-model="withdraw.occur_balance"
                           digital-keyboard=false
                           maxlength="10" step="0.01" ng-blur="fixBalance()"  placeholder="请输入提现到银行卡的金额" />
                </div>
                <div class="item">
                    <span class="title">资金密码</span>
                    <input type="password" class="txt_m" value="" maxlength="6" name="fund_password"
                           digital-keyboard="withdraw.fund_password"
                           ng-model="withdraw.fund_password" id="fund_password" placeholder="请输入资金密码" />
                </div>
            </div>
            <!-- button -->
            <div class="btnbox">
                <a class="btn" ng-click="withdrawClick()" digital-keyboard=false>确 定</a>
            </div>
        </div>

        <div class="datatables" ng-show="vm.activeTab==3" ng-controller="account_TransferDetailsCtrl">
            <div class="datatables-hd">
                <table>
                    <tr>
                        <td style="width:40%">日期</td>
                        <td style="width:25%">类型</td>
                        <td style="width:35%" class="tar">金额(元)</td>
                    </tr>
                </table>
            </div>
            <div class="datatables-bd">
                <table>
                    <thead>
                    <tr>
                        <th style="width:40%"></th>
                        <th style="width:25%"></th>
                        <th style="width:35%"></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr colspan="3" ng-if="items.length == 0"><td>还没有流水</td></tr>
                    <tr ng-if="items.length > 0" ng-repeat="item in items">
                        <td>{{item.transfer_time | defDateString}}</td>
                        <td>{{item.trans_name}}</td>
                        <td class="tar">{{item.occur_balance | number : 2}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

    </ion-content>
</ion-view>